<?php
include 'lib_conf.php';

$f_search_key = isset($_REQUEST['search_key']) ? $_REQUEST['search_key'] : '';
$a_user = array();

if ($f_search_key) {
    
    $db_query  = "select userid, username, saint from user where userid = '$f_search_key' or username like '%$f_search_key%' limit 20";
    $db_result = db_query($db_conn, $db_query);

    while ($d_row = db_fetch($db_result)) {
        $a_user[] = $d_row;
    }
}

echo json_encode($a_user); exit;
?>
